package com.fortune.rainshineservice.mapper;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.plugins.Page;
import org.apache.ibatis.annotations.Mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.fortune.rainshinecommon.base.ParmsModel;
import com.fortune.rainshinecommon.entity.ShopEntity;
import com.fortune.rainshinecommon.model.ShopModel;
import com.fortune.rainshinecommon.query.ShopQuery;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface ShopMapper extends BaseMapper<ShopModel>{

    List<ShopEntity> selectListByQuery(ShopQuery query);
    
    List<ShopModel> getListWithName(ParmsModel parm);

	Integer getCounts(ParmsModel parm);

	List<ShopModel> getShopsByUserId(Integer userId);

    ShopEntity selectByIdWithEntity(Integer shopId);

    List<ShopModel> selectByName(@Param("shopName") String shopName, @Param("userId") Integer userId);

    List<ShopModel> getMerchantShops();

    List<ShopModel> getShopsByMerchantId(@Param("merchantId") Integer merchantId);

    Date getTheLastStatTime(Integer shopId);

    Date getTheLastMonthTime(Integer shopId);

    List<ShopEntity> getAllLevel3Shops(Map<String,Object> map, Page<ShopEntity> page);

    List<ShopEntity> selectShopsBySearch(Map<String,Object> map, Page<ShopEntity> page);

    /**
     * 通过店长id获取正常营业的店铺
     * @param userId
     * @return
     */
	List<ShopModel> getShopsByUserId2(Integer userId);

    Date getMinStatDate();

    Date getMinStatMonth();
}
